import 'package:flutter/material.dart';
import 'package:gold/utils/xfg_color.dart';
import 'package:gold/utils/xfg_size.dart';
import 'package:gold/widgets/common_widgets.dart';
import 'package:gold/widgets/xfg_text.dart';

/// @description: 排行榜规则说明
/// @author tangzhentao
/// @created at 11:19 2024/12/29

class RankRulesPage extends StatelessWidget {
  const RankRulesPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: xfgAppbar(title: '规则说明'),
      body: Container(
        margin: EdgeInsets.fromLTRB(XfgSize().size10, XfgSize().size20, XfgSize().size10, XfgSize().bottomBarHeight),
        padding: EdgeInsets.fromLTRB(0, XfgSize().size26, XfgSize().size10, XfgSize().size28),
        decoration: BoxDecoration(border: Border.all(color: XfgColor.colorB5, width: XfgSize().size0_5), borderRadius: BorderRadius.circular(XfgSize().size16)),
        child: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisSize: MainAxisSize.min,
            children: [
              Container(
                margin: EdgeInsets.only(left: XfgSize().size15),
                child: XfgText('规则说明', fontSize: XfgSize().text18, color: XfgColor.text1, bold: FontWeight.bold),
              ),
              _rulesItemWidget('1:只能提现钱包余额'),
              _rulesItemWidget('2:单笔最小提现金额元，单笔最大提现规则元'),
              _rulesItemWidget('3:提现申请提交后，我们会在两小时内完成审核，审核失败提现金额会回退到余额'),
              _rulesItemWidget('4:提现申请审核成功后，您的提现将会在24小时内到账'),
              Container(
                margin: EdgeInsets.only(left: XfgSize().size15, top: XfgSize().size15),
                child: XfgText('时内到账', fontSize: XfgSize().text16, color: XfgColor.text1D),
              ),
              _rulesItemWidget('1:只能提现钱包余额'),
              _rulesItemWidget('2:单笔最小提现金额元，单笔最大提现规则元'),
              _rulesItemWidget('3:提现申请提交后，我们会在两小时内完成审核，审核失败提现金额会回退到余额'),
              _rulesItemWidget('4:提现申请审核成功后，您的提现将会在24小时内到账'),
            ],
          ),
        ),
      ),
    );
  }

  /// 规则信息布局
  Widget _rulesItemWidget(String text) => Container(
    margin: EdgeInsets.only(top: XfgSize().size14),
    padding: EdgeInsets.only(left: XfgSize().size15),
    child: XfgText(text, fontSize: XfgSize().text16, color: XfgColor.text1),
  );

}
